<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>MyJPetStore</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<header th:replace="common/top"></header>

<div id="Content">
    <div id="BackLink">
        <a th:href="@{'/catalog/viewCategory?categoryId=' + ${product.categoryId}}">
            Return to <label th:text="${product.categoryId}">Category Id</label>
        </a>
    </div>

    <div id="Catalog">

        <h2 th:text="${product.name}">Product Name</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>

            <tr th:each="item:${itemList}">
                <td><a th:href="'/catalog/viewItem?itemId=' + ${item.itemId}" th:text="${item.itemId}">ItemId</a></td>
                <td th:text="${item.product.productId}">Product ID</td>
                <td th:text="${item.attribute1}">Attribute</td>
                <td th:text="'$' + ${#numbers.formatDecimal(item.listPrice,1,2)}">List Price</td>
                <td><a th:href="'/cart/addItemToCart?workingItemId=' + ${item.itemId}">Add to Cart</a></td>
            </tr>

        </table>

    </div>

</div>

<footer th:replace="common/bottom"></footer>
</body>
</html>
